package thread.productcomsumer;

public class Product implements Runnable {
    private Source source;

    public Product(Source source) {
        this.source = source;
    }

    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            try {
                source.offer("Q"+i);
                System.out.println("生产了："+"Q"+i);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
